'''
@Project ：hdcms-scripts
@File    ：time_util.py
@IDE     ：PyCharm
@Author  ：朱广杰
@Date    ：2024/11/11 15:00
'''
import datetime,time
import random
random_number = random.randrange(3, 6)

def get_current_date():
    timeTup = time.localtime()
    currentDate = str(timeTup.tm_year) + "-" + \
                  str(timeTup.tm_mon) + "-" + str(timeTup.tm_mday)
    return currentDate

def get_next_current_date():
    timeTup = time.localtime()
    currentDate = str(timeTup.tm_year) + "-" + \
                  str(timeTup.tm_mon) + "-" + str(timeTup.tm_mday+3)
    return currentDate

def get_current_time():
    timeTup = time.localtime()
    currentTime = str(timeTup.tm_hour) + ":" + \
                  str(timeTup.tm_min) + ":" + str(timeTup.tm_sec)
    return currentTime

def get_next_2min():
    timeTup = time.localtime()
    currentTime = str(timeTup.tm_hour) + ":" + \
                  str(timeTup.tm_min+random_number) + ":" + str(timeTup.tm_sec)
    return currentTime

def get_current_datetime():
    return  get_current_date()+" "+get_current_time()


def get_next_current_datetime():
    return  get_next_current_date()+" "+get_current_time()

def get_next_2min_datetime():
    return  get_current_date()+" "+get_next_2min()
def get_now_datatime():
    return time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())

def get_now_timestamp():
    timeArray = time.strptime(time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()), "%Y-%m-%d %H:%M:%S")
    timeStamp = int(time.mktime(timeArray))*1000
    return timeStamp
if __name__ =="__main__":
    print(get_current_datetime())
    print(get_next_2min_datetime())
    print(get_next_2min())
    print(get_now_timestamp()*1000)
